package com.dk;

import com.dk.inte.*;
import com.dk.ref.BeanFactory;
import com.dk.ref.Computer;
import com.dk.ref.ComputerUtils;
import com.dk.ref.User;

public class lambdaTest {
    public static void main(String[] args) {
        UserService u = () -> System.out.println("你好");
        u.sye();

        UserService1 u1 = s -> System.out.println(s);
        u1.sye("这是有参数的接口");

        UserService2 u2 = (s,y)-> System.out.println(s+">>>>" + y);
        u2.sye("这是有","两个参数的接口");

        UserService3 u3 = (x,y)-> x+y;
        System.out.println("这是有参数也有返回值的接口" + u3.sye( + 5,6));

        Computer c = ComputerUtils::getSum;
        System.out.println(c.comput(5, 8));

        System.out.println(ComputerUtils.getSum(5, 8));

        BeanFactory b = ()->{
            User user = new User();
            return user;
        };
        b.getUser();

        BeanFactory b2 = User::new;
        b2.getUser();


    }
}
